package com.bit.forum.exception;

import com.bit.forum.common.AppResult;

/**
 *统一异常处理
 */
public class ApplicationException extends RuntimeException{


    //自定义错误
    protected AppResult errorResult;

    //自定义构造方法
    //指定状态码，异常描述
    public ApplicationException (AppResult errorResult){
        super(errorResult.getMessage());//调用父类
        this.errorResult = errorResult;
    };



    /**
     * get
     */
    public AppResult getErrorResult() {
        return errorResult;
    }

    /**
     * 重写
     */
    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
